#ifndef _SEGMENT_INCLUDE_
#define _SEGMENT_INCLUDE_

#include "../LibCommon/buffer.h"

#define INVALID_INDEX         -1

class tSegment : public tStreamBuffer
{
public:
	UINT64 Index;	
	void SegmentCopy(const tSegment& seg)
	{
		Index = seg.Index;
		if (seg.Size() != 0)
		{
			if (Size() == 0)
				Copy(seg, __FILE__, __LINE__);	
		}
	}
	tSegment():Index(INVALID_INDEX)
	{
	}
	tSegment(const tSegment& seg)
	{
		SegmentCopy(seg);
	}

	tSegment& operator=(const tSegment& seg)
	{
		SegmentCopy(seg);
		return *this;
	}	
	virtual ~tSegment()
	{
	}
};

#endif 